<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('仓库设置列表')"/>
</head>
<body class="gray-bg">

<div class="container-div" onmousemove="parent.updateTimeOut()">
    <div class="row">
        <!--			<div class="col-sm-12 search-collapse">-->
        <!--				<form id="formId">-->
        <!--					<div class="select-list">-->
        <!--						<ul>-->

        <!--							<li>-->
        <!--&lt;!&ndash;								仓库名：<input type="text" name="wareName"/>&ndash;&gt;-->
        <!--								<form class="form-horizontal m" id="form-areaInfo-add">-->
        <!--									<div class="form-group">-->
        <!--										<label class="col-sm-3 control-label">仓库：</label>-->
        <!--										<div class="col-sm-8">-->
        <!--											<select id="wareId" name="wareId" class="form-control" >-->
        <!--												<option v-for="ware in wares" v-bind:value="ware.wareId">{{ware.wareName}}</option>-->
        <!--											</select>-->
        <!--										</div>-->
        <!--									</div>-->
        <!--								</form>-->
        <!--							</li>-->


        <!--							<li>-->
        <!--								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
        <!--								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
        <!--							</li>-->
        <!--						</ul>-->
        <!--					</div>-->
        <!--				</form>-->
        <!--			</div>-->

        <div class="btn-group-sm" id="toolbar" role="group">
<!--            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:wareInfo:add">-->
<!--                <i class="fa fa-plus"></i> 添加-->
<!--            </a>-->
            <a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:wareInfo:edit">
            	<i class="fa fa-edit"></i> 修改
            </a>
            <!--<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:wareInfo:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:wareInfo:export">
                <i class="fa fa-download"></i> 导出
            </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:wareInfo:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:wareInfo:remove')}]];
    var prefix = ctx + "system/wareInfo";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "仓库设置",
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'wareId',
                    title: '仓库ID',
                    visible: false
                },
                {
                    field: 'wareCode',
                    title: '仓库编码',
                    sortable: true
                },
                {
                    field: 'wareName',
                    title: '仓库名',
                    sortable: true
                },
                /*{
                    field: 'createUserName',
                    title: '创建人',
                    sortable: true
                },
                {
                    field: 'createTime',
                    title: '创建时间',
                    sortable: true
                },
                {
                    field: 'memo',
                    title: '备注',
                    sortable: true
                },*/
                {
                    field: 'expectedWaring',
                    title: '爆仓预警',
                    sortable: true,
                    formatter:function(value,row,index){
                        if(value != null){
                            return value+"%";
                        }
                    }
                },
                {
                    field: 'alarm',
                    title: '爆仓报警',
                    sortable: true,
                    formatter:function(value,row,index){
                        if(value != null){
                            return value+"%";
                        }
                    }
                },
                {
                    field: 'stockWaring',
                    title: '呆滞过期预警(天)',
                    sortable: true,
                    formatter:function(value,row,index){
                        if(value != null){
                            return value+"天";
                        }
                    }
                },
                {
                    field: 'boxParam',
                    title: '物料数量在框中占比上限',
                    sortable: true,
                    formatter:function(value,row,index){
                        if(value != null){
                            return value+"%";
                        }
                    }
                },
                {
                    field: 'boxHeight',
                    title: '单箱可储存高度（毫米）',
                    sortable: true
                },
                {
                    field: 'boxHeight',
                    title: '单箱可储存高度（毫米）',
                    sortable: true
                },
                {
                    field: 'unqualifiedStorageDay',
                    title: '不合格物料存储天数(天)',
                    visible: true,
                    formatter:function(value,row,index){
                        if(value != null){
                            return value+"天";
                        }
                    }
                },
                /*{
                    title: '操作',
                    align: 'center',
                    fixedColumns:true,
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.wareId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        if (row.wareId !== 212) {
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.wareId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        }
                        return actions.join('');
                    }
                }*/
                ]
        };
        $.table.init(options);
    });

    var app = new Vue({
        el: '.container-div',
        data: {
            message: 'Hello Vue!',
            wares: [],
        },
        methods: {


            getWares: function () {

                var that = this;
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "/system/wareInfo/list",
                    data: {},
                    async: false,
                    error: function (request) {
                        $.modal.alertError("系统错误");
                    },
                    success: function (data) {
                        console.log(data);
                        that.wares = data.rows;
                    }
                });

            }
        },
        created: function () {
            this.getWares();

        },

    })

</script>
</body>
</html>






















